places sidebar: Plug a small memory leak
authorMatthias Clasen <mclasen@redhat.com>
Sun, 27 Mar 2016 14:59:59 +0000 (10:59 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 27 Mar 2016 22:42:25 +0000 (18:42 -0400)
_gtk_trash_moniotr_get_icon is transfer full, so we have
to unref the icon.

gtk/gtkplacessidebar.c

index 958c3a702fa021b2e8e9f689bd55f3fc3fce89a5..de4bfaf671d7cb9fea47727b1d73c41e48d332e6 100644 (file)
@@ -894,8 +894,13 @@ static void
 update_trash_icon (GtkPlacesSidebar *sidebar)
 {
   if (sidebar->trash_row)
-    gtk_sidebar_row_set_icon (GTK_SIDEBAR_ROW (sidebar->trash_row),
-                              _gtk_trash_monitor_get_icon (sidebar->trash_monitor));
+    {
+      GIcon *icon;
+
+      icon = _gtk_trash_monitor_get_icon (sidebar->trash_monitor);
+      gtk_sidebar_row_set_icon (GTK_SIDEBAR_ROW (sidebar->trash_row), icon);
+      g_object_unref (icon);
+    }
 }
 
 static void